package borge.web.teamspirit.client.data;

import java.util.ArrayList;
import java.util.List;

import borge.web.teamspirit.client.interfaces.MenuEventHandler;

public class Menu {

    private class MenuItem {
        
        public MenuItem(String aText, MenuEventHandler aEventHandler){
            iText = aText;
            iEventHandler = aEventHandler;
        }
        public String iText;
        public MenuEventHandler iEventHandler;
        
    }
    // ok..here we need to keep track of items and their handlers
    
    private List<MenuItem> iMenuItems;
   
    public Menu(){
        
        iMenuItems = new ArrayList<MenuItem>();
        
    }
    
    public void addMenuItem(String aText, MenuEventHandler aEventHandler){
        iMenuItems.add(new MenuItem(aText, aEventHandler));
    }
    
    public String getItemText(int aIndex){
        return iMenuItems.get(aIndex).iText;
    }
    
    public MenuEventHandler getItemEventHandler(int aIndex){
        return iMenuItems.get(aIndex).iEventHandler;
    }
    
}
